<template>
  <view class="activity-page">
    <view class="activity-card" v-for="activity in activities" :key="activity.id">
      <!-- 封面图片 -->
      <view class="activity-image-container">
        <image 
          :src="activity.coverImage" 
          class="activity-image" 
          mode="aspectFill"
        />
        <!-- 状态标签 -->
        <view class="status-tag" :class="activity.statusClass">
          {{ activity.status }}
        </view>
      </view>
      
      <!-- 活动信息 -->
      <view class="activity-info">
        <text class="activity-time">{{ activity.time }}</text>
        <text class="activity-description">{{ activity.description }}</text>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  name: 'VolunteerActivity',
  data() {
    return {
      activities: [
        {
          id: 1,
          coverImage: 'https://via.placeholder.com/300x200',
          status: '报名中',
          statusClass: 'status-enrolling',
          time: '2023-10-15 09:00 - 17:00',
          description: '社区清洁志愿活动，共同维护美好环境'
        },
        {
          id: 2,
          coverImage: 'https://via.placeholder.com/300x200/ff6b6b/ffffff',
          status: '已结束',
          statusClass: 'status-ended',
          time: '2023-10-10 14:00 - 16:00',
          description: '敬老院慰问活动，为老人送去温暖和关怀'
        },
        {
          id: 3,
          coverImage: 'https://via.placeholder.com/300x200/4ecdc4/ffffff',
          status: '即将开始',
          statusClass: 'status-upcoming',
          time: '2023-10-20 08:30 - 12:00',
          description: '植树造林活动，为城市增添绿色'
        }
      ]
    }
  }
}
</script>

<style scoped>
.activity-page {
  padding: 20rpx;
  background-color: #f5f5f5;
  min-height: 100vh;
}

.activity-card {
  background-color: #ffffff;
  border-radius: 16rpx;
  margin-bottom: 30rpx;
  box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.activity-image-container {
  position: relative;
  width: 100%;
  height: 300rpx;
}

.activity-image {
  width: 100%;
  height: 100%;
}

.status-tag {
  position: absolute;
  top: 20rpx;
  left: 20rpx;
  padding: 8rpx 16rpx;
  border-radius: 8rpx;
  font-size: 24rpx;
  font-weight: bold;
  color: #ffffff;
  z-index: 2;
}

.status-enrolling {
  background-color: #ff6b6b;
}

.status-ended {
  background-color: #95a5a6;
}

.status-upcoming {
  background-color: #3498db;
}

.activity-info {
  padding: 20rpx;
}

.activity-time {
  display: block;
  font-size: 28rpx;
  color: #34495e;
  margin-bottom: 10rpx;
  font-weight: bold;
}

.activity-description {
  display: block;
  font-size: 26rpx;
  color: #7f8c8d;
  line-height: 1.5;
}
</style>